<?

$pagename = "Log out";
session_start();
// location: assumes that login.php and logout.php are located in the base public directory 
// and both the variables and functions php files are in an includes directory
require("includes/variables.php");
require("includes/functions_general.php");
mysqlconnect($site['mysql_user'], $site['mysql_password'], $site['mysql_db']);

$_SESSION = array();
if (isset($_COOKIE[session_name()])) {
    setcookie(session_name(), '', time()-42000, '/');
}
session_destroy();


include("includes/header.php");
echo "<h1>Logged out</h1>";
$redirectmessage = "You have been logged out and will be redirected ";
redirectCountdown("index.php", 3, $redirectmessage);

include("includes/footer.php");
?>